package com.yld.demo2.service.Impl;

import com.yld.demo2.entity.table.OrderList;
import com.yld.demo2.entity.vo.OrderListVo;
import com.yld.demo2.mapper.OrderListMapper;
import com.yld.demo2.service.OrderListService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class OrderListServiceImpl implements OrderListService {

    @Resource
    OrderListMapper orderListMapper;


    @Override
    public OrderListVo selectByUserId(@Param("user_id") Integer userid){
        return orderListMapper.selectByUserId(userid);
    }

    @Override
    public List<OrderListVo> selectAll() {
        return orderListMapper.selectAll();
    }

    @Override
    public Boolean insertAll(OrderListVo orderListVo) {
        return orderListMapper.insertAll(orderListVo);
    }

    @Override
    public Boolean deleteByOrderNo(Integer orderno) {
        return orderListMapper.deleteByOrderNo(orderno);
    }

    @Override
    public Boolean updateByOrderNo(OrderListVo orderList) {
        return orderListMapper.updateByOrderNo(orderList);
    }

    @Override
    public List<OrderListVo> selectAllByUserId(Integer userid) {
        return orderListMapper.selectAllByUserId(userid);
    }

    @Override
    public Integer selectUserIdByOrderNo(Integer orderno) {
        return orderListMapper.selectUserIdByOrderno(orderno);
    }

}
